//
// Created by 123 on 2024/12/31.
//
/**
* 类做友元
*/

#include "iostream"
using namespace std;


//提前声明下House类
class House;
class GoodGay{
private:
    House* house;
public:
    //构造方法
    GoodGay();
    //声明函数
    void visit();
};

class House{
    //GoodGay类是Building类的好朋友，可以访问到Building类中私有内容
    friend class GoodGay;

private:
    string bedroom;
public:
    string sitroom;
    //构造函数
    House();
};

House::House() {
    this->sitroom = "sitroom";
    this->bedroom = "bedroom";
}
GoodGay::GoodGay() {
    house = new House;
}

void GoodGay::visit() {
    cout << "your good gay vist " << house->bedroom << endl;
    cout << "your good gay vist " << house->sitroom << endl;
}



void test(){
    GoodGay gg = GoodGay();
    gg.visit();

}

int main070(){
    test();
    return 0;
}